<%@ page import="openvote.Candidato"%>
<!DOCTYPE html>
<html>
<head>
<g:set var="name" value="teste" />
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'candidato.label', default: 'Candidato')}" />
<title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
	<a href="#list-candidato" class="skip" tabindex="-1"><g:message
			code="default.link.skip.label" default="Skip to content&hellip;" /></a>
	<div class="nav" role="navigation">
	
	</div>


	<g:form controller="candidato" action="pesquisa" params="[nome,numero,partido]">
		<br />
		<br />
		<p>Nome</p>
		<g:textField name="nome" />
		
		
		<br />
		<br />
		<p>Numero</p>
		<g:textField name="numero" />

		<br />
		<br />
		<p>Partido</p>
		<g:textField name="partido" />


		<br />
		<br />
		<g:actionSubmit value="Submit" action="pesquisa" />
	</g:form>

	<div id="list-candidato" class="content scaffold-list" role="main">
		<h1>
			<g:message code="default.list.label" args="[entityName]" />
		</h1>
		<g:if test="${flash.message}">
			<div class="message" role="status">
				${flash.message}
			</div>
		</g:if>
		<table>
			<thead>
				<tr>

					<g:sortableColumn property="numero"
						title="${message(code: 'candidato.numero.label', default: 'Numero')}" />

					<g:sortableColumn property="nome"
						title="${message(code: 'candidato.nome.label', default: 'Nome')}" />

					<g:sortableColumn property="partido"
						title="${message(code: 'candidato.partido.label', default: 'Partido')}" />

					<g:sortableColumn property="sexo"
						title="${message(code: 'candidato.sexo.label', default: 'Sexo')}" />

					<g:sortableColumn property="estadoCivil"
						title="${message(code: 'candidato.estadoCivil.label', default: 'Estado Civil')}" />

					<g:sortableColumn property="CPF"
						title="${message(code: 'candidato.CPF.label', default: 'CPF')}" />

				</tr>
			</thead>
			<tbody>
				<g:each in="${candidatoInstanceList}" status="i"
					var="candidatoInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

						<td><g:link action="show" id="${candidatoInstance.id}">
								${fieldValue(bean: candidatoInstance, field: "numero")}
							</g:link></td>

						<td>
							${fieldValue(bean: candidatoInstance, field: "nome")}
						</td>

						<td>
							${fieldValue(bean: candidatoInstance, field: "partido")}
						</td>

						<td>
							${fieldValue(bean: candidatoInstance, field: "sexo")}
						</td>

						<td>
							${fieldValue(bean: candidatoInstance, field: "estadoCivil")}
						</td>

						<td>
							${fieldValue(bean: candidatoInstance, field: "cpf")}
						</td>

					</tr>
				</g:each>
			</tbody>
		</table>
		<div class="pagination">
			<g:paginate total="${candidatoInstanceTotal}" />
		</div>
	</div>
</body>
</html>